package com.myosw.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.myosw.jdbc.common.QueryHelper;
import com.myosw.pojo.Filterlog;

public class FilterDao 
{
				public int getlogCount(long filterid) 
				{
					Filterlog bean = new Filterlog();
					String filter = " filter = "+filterid;
					return bean.totalCount(filter );
				}
				
				
				public List<Filterlog> getlogList(int page,int size,long filterid) 
				{
					Filterlog bean = new Filterlog();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("filter", filterid);
					return (List<Filterlog>) bean.getlist(page,size,map);
				}
				
				public List<Filterlog> getlogChange(long filterid) 
				{
					String sql ="SELECT filterlog.id, filterlog.filter, filterlog.count, filterlog.newcount, filterlog.updatetime "+
				 " FROM myosw_filterlog filterlog"+
				 " WHERE filterlog.filter =? "+
				 "GROUP BY filterlog.count, filterlog.newcount "+
				 " ORDER BY filterlog.id ASC ";
					return QueryHelper.query(Filterlog.class, sql, filterid);
					
				}
}
